const Global = {

}

const CacheKeys = {
	token: 'token',
	userInfo: 'userInfo', //用户缓存key
	msgIndex: 'msgIndex' //消息列表缓存
}

const Sql = {
	createMessage: 'create table if not exists  "message" (' +
		'  "id" text(32) NOT NULL,' +
		'  "chatType" integer(3),' + //聊天类型int类型(0:系统消息,1:公聊,2:私聊)
		'  "cmd" integer(3) NOT NULL,' + //命令码(11)int类型
		'  "msgType" integer(3),' + //消息类型int类型(0:text、1:image、2:voice、3:vedio、4:music、5:news)
		'  "content" TEXT(800),' +
		'  "createTime" TEXT(14) NOT NULL COLLATE BINARY,' +
		'  "from" TEXT(32),' +
		'  "to" TEXT(32),' +
		'  "group_id" text(64),' + //群组id仅在chatType为(1)时需要,String类型
		'  "extras" TEXT(500),' + //扩展字段,JSON对象格式如：{'扩展字段名称':'扩展字段value'}
		'  "isRead" integer(1) NOT NULL DEFAULT 0,' + //0:未读；1:已读
		'  PRIMARY KEY ("id")' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_chatType"' +
		'ON "message" (' +
		'  "chatType"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_cmd"' +
		'ON "message" (' +
		'  "cmd"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_createTime"' +
		'ON "message" (' +
		'  "createTime" COLLATE BINARY DESC' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_from"' +
		'ON "message" (' +
		'  "from"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_group_id"' +
		'ON "message" (' +
		'  "group_id"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_msgType"' +
		'ON "message" (' +
		'  "msgType"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_to"' +
		'ON "message" (' +
		'  "to"' +
		');' +
		'' +
		'CREATE INDEX if not exists "message_isRead"' +
		'ON "message" (' +
		'  "isRead"' +
		');',
	createIndex: 'CREATE TABLE  if not exists  "index" (' +
		' "chatType" integer(2) NOT NULL,' +
		' "msgType" integer(3) NOT NULL,' +
		' "content" TEXT(64),' +
		' "createTime" TEXT(14) NOT NULL COLLATE BINARY,' +
		' "from" TEXT(32) NOT NULL,' +
		' "to" TEXT(32),' +
		' "group_id" text(64),' +
		' "extras" TEXT(600) NOT NULL,' +
		' "count" integer(9) NOT NULL DEFAULT 0,' +
		' "userId" TEXT(32) NOT NULL,' +   //消息归属人
		'  PRIMARY KEY ("group_id")' +
		');' +
		'' +
		'CREATE INDEX if not exists "index_createTime"' +
		'ON "index" (' +
		'  "createTime" COLLATE BINARY DESC' +
		');' +
		'' +
		'CREATE INDEX if not exists "index_to"' +
		'ON "index" (' +
		'  "to"' +
		');' +
		'' +
		'CREATE INDEX if not exists "index_userId"' +
		'ON "index" (' +
		'  "userId"' +
		');' +
		'' +
		'CREATE INDEX if not exists "index_group_id"' +
		'ON "index" (' +
		'  "group_id"' +
		');',
	createRcontact: 'CREATE TABLE if not exists "rcontact" (  ' +
		'"userId" text(32) NOT NULL,  ' +
		'"friendId" text(32) NOT NULL,  ' +
		'"friendNickName" TEXT(32) NOT NULL,  ' +
		'"friendMobile" TEXT(30),  ' +
		'"status" integer(2) NOT NULL DEFAULT 0,  ' +
		'"type" integer(2) NOT NULL DEFAULT 0,  ' +
		'"portIsView" integer(2) NOT NULL DEFAULT 0,  ' +
		'"portIsShow" integer(2) NOT NULL DEFAULT 0,  ' +
		'"group_id" text(64),  ' +
		'"updateDttm" TEXT(20) NOT NULL,  ' +
		'PRIMARY KEY ("userId", "friendId", "group_id")  ' +
		');  ' +
		'CREATE INDEX if not exists "rcontact_friendId"  ' +
		'ON "rcontact" (  ' +
		'"friendId"  ' +
		');  ' +
		'CREATE INDEX if not exists "rcontact_group_id_userId"  ' +
		'ON "rcontact" (  ' +
		'"group_id",  ' +
		'"userId"  ' +
		');  ' +
		'CREATE INDEX if not exists "rcontact_updateDttm"  ' +
		' ON "rcontact" (  ' +
		'  "updateDttm" COLLATE BINARY DESC  ' +
		');'
}

const emojiList=[
	[{url:"100.gif",code:"#100",text:"微笑"},{url:"102.gif",code:"#102",text:"美女"},{url:"103.gif",code:"#103",text:"发呆"},{url:"104.gif",code:"#104",text:"墨镜"},{url:"105.gif",code:"#105",text:"哭"},{url:"106.gif",code:"#106",text:"羞"},{url:"107.gif",code:"#107",text:"哑"},{url:"108.gif",code:"#108",text:"睡"},{url:"109.gif",code:"#109",text:"哭"},{url:"110.gif",code:"#110",text:"囧"},{url:"111.gif",code:"#111",text:"怒"},{url:"112.gif",code:"#112",text:"调皮"},{url:"113.gif",code:"#113",text:"笑"},{url:"114.gif",code:"#114",text:"惊讶"},{url:"115.gif",code:"#115",text:"难过"},{url:"116.gif",code:"#116",text:"酷"},{url:"117.gif",code:"#117",text:"汗"},{url:"118.gif",code:"#118",text:"抓狂"},{url:"119.gif",code:"#119",text:"吐"},{url:"120.gif",code:"#120",text:"笑"},{url:"121.gif",code:"#121",text:"快乐"},{url:"122.gif",code:"#122",text:"奇"},{url:"123.gif",code:"#123",text:"傲"},{url:"delete.png",text:"删除"}],
	[{url:"124.gif",code:"#124",text:"饿"},{url:"126.gif",code:"#126",text:"吓"},{url:"127.gif",code:"#127",text:"汗"},{url:"128.gif",code:"#128",text:"高兴"},{url:"129.gif",code:"#129",text:"闲"},{url:"130.gif",code:"#130",text:"努力"},{url:"131.gif",code:"#131",text:"骂"},{url:"132.gif",code:"#132",text:"疑问"},{url:"133.gif",code:"#133",text:"秘密"},{url:"134.gif",code:"#134",text:"乱"},{url:"135.gif",code:"#135",text:"疯"},{url:"136.gif",code:"#136",text:"哀"},{url:"137.gif",code:"#137",text:"鬼"},{url:"138.gif",code:"#138",text:"打击"},{url:"139.gif",code:"#139",text:"bye"},{url:"140.gif",code:"#140",text:"汗"},{url:"141.gif",code:"#141",text:"抠"},{url:"142.gif",code:"#142",text:"鼓掌"},{url:"143.gif",code:"#143",text:"糟糕"},{url:"144.gif",code:"#144",text:"恶搞"},{url:"145.gif",code:"#145",text:"什么"},{url:"146.gif",code:"#146",text:"什么"},{url:"147.gif",code:"#147",text:"累"},{url:"delete.png",text:"删除"}],
	[{url:"148.gif",code:"#148",text:"看"},{url:"150.gif",code:"#150",text:"难过"},{url:"151.gif",code:"#151",text:"坏"},{url:"152.gif",code:"#152",text:"亲"},{url:"153.gif",code:"#153",text:"吓"},{url:"154.gif",code:"#154",text:"可怜"},{url:"155.gif",code:"#155",text:"刀"},{url:"156.gif",code:"#156",text:"水果"},{url:"157.gif",code:"#157",text:"酒"},{url:"158.gif",code:"#158",text:"篮球"},{url:"159.gif",code:"#159",text:"乒乓"},{url:"160.gif",code:"#160",text:"咖啡"},{url:"161.gif",code:"#161",text:"美食"},{url:"162.gif",code:"#162",text:"动物"},{url:"163.gif",code:"#163",text:"鲜花"},{url:"164.gif",code:"#164",text:"枯"},{url:"165.gif",code:"#165",text:"唇"},{url:"166.gif",code:"#166",text:"爱"},{url:"167.gif",code:"#167",text:"分手"},{url:"168.gif",code:"#168",text:"生日"},{url:"169.gif",code:"#169",text:"电"},{url:"170.gif",code:"#170",text:"炸弹"},{url:"171.gif",code:"#171",text:"刀子"},{url:"delete.png",text:"删除"}],
	[{url:"172.gif",code:"#172",text:"足球"},{url:"174.gif",code:"#174",text:"翔"},{url:"175.gif",code:"#175",text:"月亮"},{url:"176.gif",code:"#176",text:"太阳"},{url:"177.gif",code:"#177",text:"礼物"},{url:"178.gif",code:"#178",text:"抱抱"},{url:"179.gif",code:"#179",text:"拇指"},{url:"180.gif",code:"#180",text:"贬低"},{url:"181.gif",code:"#181",text:"握手"},{url:"182.gif",code:"#182",text:"剪刀手"},{url:"183.gif",code:"#183",text:"抱拳"},{url:"184.gif",code:"#184",text:"勾引"},{url:"185.gif",code:"#185",text:"拳头"},{url:"186.gif",code:"#186",text:"小拇指"},{url:"187.gif",code:"#187",text:"拇指八"},{url:"188.gif",code:"#188",text:"食指"},{url:"189.gif",code:"#189",text:"ok"},{url:"190.gif",code:"#190",text:"情侣"},{url:"191.gif",code:"#191",text:"爱心"},{url:"192.gif",code:"#192",text:"蹦哒"},{url:"193.gif",code:"#193",text:"颤抖"},{url:"194.gif",code:"#194",text:"怄气"},{url:"195.gif",code:"#195",text:"跳舞"},{url:"delete.png",text:"删除"}],
	[{url:"196.gif",code:"#196",text:"发呆"},{url:"173.gif",code:"#173",text:"瓢虫"},{url:"149.gif",code:"#149",text:"难过"},{url:"125.gif",code:"#125",text:"累"},{url:"101.gif",code:"#101",text:"伤心"},{url:"197.gif",code:"#197",text:"背着"},{url:"198.gif",code:"#198",text:"伸手"},{url:"199.gif",code:"#199",text:"耍帅"},{url:"delete.png",text:"删除"}]				
 ]
import convert from 'emoji-convert';
for(let element of emojiList){
     convert.extend(element);
}

const sysParams = uni.getSystemInfoSync();
export default {
	Global,
	CacheKeys,
	Sql,
	emojiList,
	convert,
	sysParams
}
